package com.yj.idempotence.service;

import com.yj.idempotence.dynamicDataSource.ChooseDataSource;
import com.yj.idempotence.dynamicDataSource.DynamicDataSourceType;
import com.yj.idempotence.mapper.UserMapper;
import com.yj.idempotence.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;


    @Override
    @ChooseDataSource(DynamicDataSourceType.DEV_DATASOURCE)
    public List<User> findAll() {
        return userMapper.findUser();
    }
}
